package com.czkt.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.czkt.entity.BasDict;
import com.czkt.entity.vo.CstCustomerBasDict;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2024-06-18
 */
@Mapper
public interface BasDictMapper extends BaseMapper<BasDict> {

    @Select("select * from bas_dict where dict_id like concat('%',#{dictId},'%') and dict_item like concat('%',#{dictItem},'%') and dict_type = '客户等级'")
    IPage<BasDict> selectBasDictList(IPage<BasDict> basDictIPage,@Param("dictId")String dictId,@Param("dictItem")String dictItem);

    @Select("select * from bas_dict where dict_id = #{dictId};")
    BasDict selectBasDict(String dictId);

    @Select("update bas_dict set dict_item=#{dictItem} where dict_id=#{dictId};")
    void toUpdateBasDict(BasDict basDict);

    @Select("delete from bas_dict where dict_id = #{dictId};")
    void deleteBasDict(String dictId);

    @Select("insert into bas_dict ( dict_type, dict_item, dict_value) values (#{dictType},#{dictItem},#{dictValue});")
    void toInsertBasDict(BasDict basDict);

    @Select("select * from bas_dict where dict_type = '地区';")
    List<BasDict> selectByDictType();


    @Select("select * from bas_dict where dict_type = '客户等级';")
    List<BasDict> selectByDict();


    @Select("select * from bas_dict where dict_type = '服务类型';")
    List<BasDict> selectDictFW();

    @Select("select * from bas_dict where dict_type = '服务状态';")
    List<BasDict> selectDictStatus();

}
